<?php

/**
 * 用户模型
 */

namespace Common\Model;

use Think\Model;

class OptionsModel extends Model {

    protected $tableName = 'options';

    public function getByModule($module, $if_handle = 0) {
        $config = $this->where(array('option_module' => $module))->select();
        $data = array();
        if ($if_handle) {
            foreach ($config as $v) {
                $data[$v['option_name']] = $v['option_value'];
            }
        } else {
            $data = $config;
        }
        return $data;
    }

}
